-- 尝试 Krnl 的自带 HTTP 函数
local response = request({
    Url = "https://fifa-player.shopwegame.com/api/fifa/squad/detail",
    Method = "POST",
    Headers = {
        ["Content-Type"] = "application/json"
    },
    Body = game:GetService("HttpService"):JSONEncode({
        id = "02606587566727889920"
    })
})

print(response.Body)




local data = {
    authSecret = "8f9dbe334ca364eac2b18ca437fde25d",
    orderStatus = 2,
    orderMainId = "1963837543936765954"
}

local response = request({
    Url = "https://u7playearn.shopwegame.com/dev-api/play-earn/api/order/sync",
    Method = "POST",
    Headers = {
        ["Content-Type"] = "application/json"
    },
    Body = HttpService:JSONEncode(data)
})

if response.Success then
    print("请求成功:", response.Body)
else
    warn("请求失败:", response.StatusCode, response.StatusMessage)
end


local lokiData = {
    streams = {
        {
            stream = {
                job = "my-app",
            },
            values = {
                { "1757581409000000000", "中文测试信息1757581308." }
            }
        }
    }
}
local data = {
    streams = {
        {
            stream = {
                job = "my-app",
            },
            values = {
                { "1757581409000000000", "中文测试信息1757581308." }
            }
        }
    }
}

local response = request({
    Url = "https://lokipush.shopwegame.com/loki/api/v1/push",
    Method = "POST",
    Headers = {
        ["Content-Type"] = "application/json"
    },
    Body = HttpService:JSONEncode(data)
})

if response.Success then
    print("请求成功:", response.Body)
else
    warn("请求失败:", response.StatusCode, response.StatusMessage)
end



-- 完整请求函数
local response = request({
    Url = "https://192.168.20.211:8818",
    Method = "GET", -- POST, PUT, DELETE, PATCH
    Headers = {
        ["Content-Type"] = "application/json",
        ["Authorization"] = "Bearer token"
    },
    Body = '{"data": "value"}',
    Cookies = {["session"] = "abc123"}
})

if response.Success then
    print("请求成功:", response.Body)
else
    print("请求失败:", response.StatusCode, response.StatusMessage)
end
